/**
 * Created by liguangsong on 16/8/5.
 */
import { SELECT_HOME, SELECT_VISITOR } from '../action/index.js'

function initialState() {
    return {
        background: {
            home: 'white',
            //home: 'yellow',
            visitor: 'rgb(230, 230, 230)'
        },
        color: {
            home: 'black',
            visitor: 'rgb(121, 133, 155)'
        },
        left: '0'
    };
}

function selectTeam(state=initialState(), action) {
    //console.log(action);
    switch (action.type) {
        case SELECT_HOME: {
            return {
                background: {
                    home: 'white',
                    visitor: 'rgb(230, 230, 230)'
                },
                color: {
                    home: 'black',
                    visitor: 'rgb(121, 133, 155)'
                },
                left: '0'
            };
        }
        case SELECT_VISITOR: {
            return  {
                background: {
                    visitor: 'white',
                    home: 'rgb(230, 230, 230)'
                },
                color: {
                    visitor: 'black',
                    home: 'rgb(121, 133, 155)'
                },
                left: '490px'
            };
        }
        default: {
            return state;
        }
    }
}

export default selectTeam;